// C# .NET 6 MAUI Blazor 桌面程序入口
// 功能：使用 MAUI Blazor 加载本地 HTML 文件并打包为 Windows 桌面应用
using Microsoft.AspNetCore.Components.WebView.WindowsForms;\using Microsoft.Extensions.DependencyInjection;
using System.Windows.Forms;

namespace TP_DataCheck_Desktop
{
    internal static class Program
    {
        [STAThread]
        static void Main()
        {
            ApplicationConfiguration.Initialize();

            var services = new ServiceCollection();
            services.AddWindowsFormsBlazorWebView();

            var form = new Form
            {
                Text = "TP-BMS 电芯测试数据分析",
                Width = 1200,
                Height = 800,
                StartPosition = FormStartPosition.CenterScreen
            };

            var blazor = new BlazorWebView
            {
                Dock = DockStyle.Fill,
                HostPage = "wwwroot/index.html"
            };
            blazor.RootComponents.Add<Main>("#app");

            form.Controls.Add(blazor);
            Application.Run(form);
        }
    }
}